ST4K[V2].js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. var rule = {
  2. title: 'ST4K[V2]', // csp_AppYsV2
  3. host: 'http://dh.li0580.com:6532/api.php/app/',
  4. url: 'video?tid=fyclassfyfilter&limit=20&pg=fypage',
  5. filter_url: '&class={{fl.class}}&area={{fl.area}}&lang={{fl.lang}}&letter={{fl.letter}}&year={{fl.year}}&by={{fl.by}}',
  6. filter: 'H4sIAAAAAAAAA+2Y3W4aRxTH34VrX+wS56N5lSoXqEK9iOuLRK0URZZsYwgQx2DLwaHgr8YY4hoMtuPCUuBldnaXt+iwZ84HUb1atVauuON3zp7ZOWeY85/Ztwk78fzHt4mX6TeJ54mfVlKvXyeWEqupX9IaVaHpZbKaf0ut/JoOn1udmbOtaaY1M2tIrC0Za6WunzdWA+jz8z0zEAP6vI2yt14xPgM0ZrHljuo4JgCN2dxVgyGOCUBxNHEGel/+k+sU8H0A6Ava52r7wvgM0PuKV/4IfQbEPP39Ic9zBuRrvON5GqC5tM/d8QnOBYDicnvT6heMA6C4ows9c4wDiFNPb/PSr+yiD4B8maK3+Tv6ACj3YUll+5g7APqmh3vep4bxGaAxK++CgoNjAlB+446//1WNepgiMT1ROgs+0yoCkG8np0rX6AOgVZyU9RrgKgJwVeve4S5VNQTybU38PzETA1SB0a4/rM9NeM609mL2JOyi1Kt0SmyieldtO3E30VlzWs3hFACo0OdVr3+FhQbgUnW9wZhKFQJNfbyjaiOcNAAt0M1H9hmgMr7vsc8AxR00vPolxgHQPI+/cJwBXvS/2GeA59KVc+nOxX3oKucc4wAobqukK6XyuFeYKZPGxC+1/UIVkyHmDXzivZ/oMNrDyPRE9s4d4rYyIBd9JbX6My96cNUOWutxF7020s/j0ABiEdhngBb2+ox9BmgRDkbqwwG7mcUyCTeAWF72GRB/GeEDEMsrMgEQBVSdDBdwBrKAb9KpV2LXDG7d4ShmAZNW8pGxhT+FPcn2pLTbbLel3WK7Jez2D2TXP4X9GdufSftTtj+V9idsfyLtj9n+WNqX2b4s7ZyvLfO1OV9b5mtzvrbM1+Z8bZmvxflaMl+L87VkvhbnZcm8LM7LknlZnJf+qf8GL5YSyYc6iETIRpT4g3apjTuVKc3JmTHFOeiozp1yaAMAxDxA3HvQiTpARB10oiQyStDdwSlLpAE+JGS9KmqQAXrfxxwfSgwI+eSaGYjbWf+PnOay+nlS+xDiyNR/ldooWYyW4fulL1KGK12tVOrwlI5YyAvZ+ka2FvKzkJ9I+Xn0QPIzXS/4zXX8gwLI9rl1LNqnBtoynUnQzeOWAaC4vbZXxJuJAf7TZ71+n/70IfBmuXEHZdosIYh+NP2MczFAPudCdY7QB0Dvq12LOx0Axe0fe7d0JweguH7fy5dcZ4/vZnMmqsPtH1qQsA4ANEZvM9jYxmiA7yAVuv3rRk+TDkH0HN2FuOfMgHyXTV1Y9AEsmu+i+S6a77fNd/mBmm9Ug436YOhn2sEpNm0DNOZOyy/jNxkD5Csf+Zf0QQ2AO8r9H/CC8mGwg/cQAzTmyamq0UYCiHNP8OqO+CgIQO+L+CQWdSdSXV2mW3wfgPQ1boRPA9XzbOz+jR8TDfC95Fjla3QvCYHuHs61aqNgGaAxa0WvisJjgOvSU5MDqksI3+N+URu5Dl0FAeLcBf5VGBYn9oVoLEQjtmis/QN1egR0uxoAAA==',
  7. detailUrl: '/detail?vod_id=fyid',
  8. searchUrl: '/search?text=**&pg=fypage',
  9. searchable: 2,
  10. quickSearch: 0,
  11. filterable: 1,//是否启用分类筛选,
  12. headers: {'User-Agent': 'okhttp/4.1.0'},
  13. timeout: 5000,
  14. // 分类筛选 /api.php/app/nav || /xgapp.php/v1/nav || /api.php/v1.vod/types
  15. class_name: '电影&电视剧&综艺&动漫',
  16. class_url: '1&2&3&4',
  17. play_parse: true,
  18. lazy:'js:input="http://jx.li0580.com/home/api?type=ys&uid=2712055&key=dfijoyBCDFGMOTYZ03&url="+input.split("?")[0];log(input);let html=JSON.parse(request(input));log(html);input=html.url||input',
  19. /*
  20. lazy: `js:
  21. let play_Url = '';
  22. if (/\\.m3u8|\\.mp4/.test(input)) {
  23. input = {
  24. jx: 0,
  25. url: input,
  26. parse: 0
  27. }
  28. } else if (/,/.test(input) && /url=/.test(input)) {
  29. input = input.split('url=');
  30. play_Url = input[0].split(',')[0];
  31. input = {
  32. jx: 0,
  33. url: input[1],
  34. playUrl: play_Url,
  35. parse: 1
  36. }
  37. } else if (/url=|id=/.test(input)) {
  38. input = {
  39. jx: 0,
  40. url: JSON.parse(request(input)).url,
  41. parse: 0
  42. }
  43. } else if (/youku|iqiyi|v\\.qq\\.com|pptv|sohu|le\\.com|1905\\.com|mgtv|bilibili|ixigua/.test(input)) {
  44. play_Url = /bilibili/.test(input) ? 'https://jx.xmflv.com/?url=' : 'https://jx.xmflv.com/?url='; // type0的parse
  45. // play_Url = /bilibili/.test(input) ? 'https://jx.xmflv.com/?url=' : 'json:http://pandown.pro/app/kkdy.php?url='; // type1的parse可加'json:'直接解析url (除了蜂蜜的'影视TV',其它的壳皆可用)
  46. input = {
  47. jx: 0,
  48. url: input,
  49. playUrl: play_Url,
  50. parse: 1,
  51. header: JSON.stringify({
  52. 'user-agent': 'Mozilla/5.0',
  53. }),
  54. }
  55. } else {
  56. input
  57. }
  58. `,
  59. */
  60. limit: 6,
  61. // 图片来源:'@Referer=https://api.douban.com/@User-Agent=Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/113.0.0.0%20Safari/537.36',
  62. 推荐: `js:
  63. let d = [];
  64. let jsondata = [];
  65. let videoList = [];
  66. if (/v1\\.vod/.test(HOST)) {
  67. if(HOST.endsWith('/')){
  68. jsondata = JSON.parse(request(HOST + 'vodPhbAll'));
  69. } else {
  70. jsondata = JSON.parse(request(HOST + '/vodPhbAll'));
  71. }
  72. videoList = jsondata.data.list;
  73. } else {
  74. if(HOST.endsWith('/')){
  75. jsondata = JSON.parse(request(HOST + 'index_video'));
  76. } else {
  77. jsondata = JSON.parse(request(HOST + '/index_video'));
  78. }
  79. videoList = /xgapp/.test(HOST) ? jsondata.data : jsondata.list;
  80. }
  81. // log('videoList =========> '+stringify(videoList));
  82. videoList.forEach((it,idex) => {
  83. let vlist = /v1\\.vod/.test(HOST) ? videoList[idex].vod_list : videoList[idex].vlist ;
  84. vlist.forEach(it => {
  85. d.push({
  86. url:it.vod_id,
  87. title:it.vod_name,
  88. img:it.vod_pic.startsWith('http') ? it.vod_pic : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  89. desc:it.vod_remarks,
  90. });
  91. });
  92. });
  93. setResult(d);
  94. `,
  95. 一级: `js:
  96. let d = [];
  97. let jsondata = [];
  98. let videoList = [];
  99. if (/v1\\.vod/.test(HOST)) {
  100. input = input.replace('video','v1.vod').replace('tid','type').replace('pg=','page=');
  101. jsondata = JSON.parse(request(input));
  102. videoList = jsondata.data.list;
  103. } else {
  104. input = HOST + '/'+ input.split('/')[4];
  105. jsondata = JSON.parse(request(input));
  106. videoList = jsondata.list || jsondata.data;
  107. }
  108. // log('videoList =========> '+stringify(videoList));
  109. videoList.forEach(it => {
  110. d.push({
  111. url:it.vod_id,
  112. title:it.vod_name,
  113. img:it.vod_pic.startsWith('http') ? it.vod_pic : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  114. desc:it.vod_remarks,
  115. });
  116. });
  117. setResult(d);
  118. `,
  119. 二级: `js:
  120. if (/v1\\.vod/.test(HOST)) {
  121. input = HOST + '/'+ input.split('/')[3];
  122. } else {
  123. input = HOST + '/'+ input.split('/')[3].replace('detail','video_detail').replace('vod_id','id');
  124. }
  125. try {
  126. let html = request(input);
  127. html = JSON.parse(html);
  128. let node = /xgapp/.test(HOST) ? html.data.vod_info : html.data;
  129. VOD = {
  130. vod_id: node.vod_id,
  131. vod_name: node.vod_name,
  132. vod_pic: node.vod_pic,
  133. type_name: node.vod_class,
  134. vod_year: node.vod_year,
  135. vod_area: node.vod_area,
  136. vod_remarks: node.vod_remarks,
  137. vod_actor: node.vod_actor,
  138. vod_director: node.vod_director,
  139. vod_content: node.vod_content.strip()
  140. };
  141. if (typeof play_url === 'undefined') {
  142. var play_url = ''
  143. }
  144. var name = {
  145. 'bfzym3u8': '暴风',
  146. '1080zyk': '优质',
  147. 'kuaikan': '快看',
  148. 'lzm3u8': '量子',
  149. 'ffm3u8': '非凡',
  150. 'haiwaikan': '海外看',
  151. 'gsm3u8': '光速',
  152. 'zuidam3u8': '最大',
  153. 'bjm3u8': '八戒',
  154. 'snm3u8': '索尼',
  155. 'wolong': '卧龙',
  156. 'xlm3u8': '新浪',
  157. 'yhm3u8': '樱花',
  158. 'tkm3u8': '天空',
  159. 'jsm3u8': '极速',
  160. 'wjm3u8': '无尽',
  161. 'sdm3u8': '闪电',
  162. 'kcm3u8': '快车',
  163. 'jinyingm3u8': '金鹰',
  164. 'fsm3u8': '飞速',
  165. 'tpm3u8': '淘片',
  166. 'lem3u8': '鱼乐',
  167. 'dbm3u8': '百度',
  168. 'tomm3u8': '番茄',
  169. 'ukm3u8': 'U酷',
  170. 'ikm3u8': '爱坤',
  171. 'hnzym3u8': '红牛资源',
  172. 'hnm3u8': '红牛',
  173. '68zy_m3u8': '68',
  174. 'kdm3u8': '酷点',
  175. 'bdxm3u8': '北斗星',
  176. 'qhm3u8': '奇虎',
  177. 'hhm3u8': '豪华',
  178. 'kbm3u8': '快播'
  179. };
  180. let episodes = /v1\\.vod/.test(HOST)?node.vod_play_list:node.vod_url_with_player;
  181. if (episodes != '') {
  182. let playMap = {};
  183. let arr = [];
  184. episodes.forEach(ep => {
  185. let from = [];
  186. if (/v1\\.vod/.test(HOST)) {
  187. from = ep.player_info.from||ep.player_info.show||ep.from||ep.show;
  188. } else {
  189. from = ep.code||ep.name;
  190. }
  191. if (!playMap.hasOwnProperty(from)) {
  192. playMap[from] = []
  193. }
  194. // let parse_api = '';
  195. // if (/v1\\.vod/.test(HOST)) {
  196. // parse_api = ep.player_info.parse != null ? ep.player_info.parse : ep.player_info.parse2;
  197. // // parse_api = /,/.test(parse_api) ? parse_api.split(',')[1] : parse_api;
  198. // } else {
  199. // parse_api = ep.parse_api;
  200. // }
  201. // log('parse_api =========> '+parse_api);
  202. // if (parse_api != null && !/\\.m3u8|\\.mp4/.test(ep.url)) {
  203. // parse_api = parse_api.replaceAll('..','.') ;
  204. // ep.url = ep.url.replaceAll('$','$'+parse_api);
  205. // }
  206. if (from != null) playMap[from].push(ep.url)
  207. });
  208. for (var key in playMap) {
  209. if ('bfzym3u8' == key) {
  210. arr.push({
  211. flag: name[key],
  212. url: playMap[key],
  213. sort: 1
  214. })
  215. } else if ('1080zyk' == key) {
  216. arr.push({
  217. flag: name[key],
  218. url: playMap[key],
  219. sort: 2
  220. })
  221. } else if ('kuaikan' == key) {
  222. arr.push({
  223. flag: name[key],
  224. url: playMap[key],
  225. sort: 3
  226. })
  227. } else if ('lzm3u8' == key) {
  228. arr.push({
  229. flag: name[key],
  230. url: playMap[key],
  231. sort: 4
  232. })
  233. } else if ('ffm3u8' == key) {
  234. arr.push({
  235. flag: name[key],
  236. url: playMap[key],
  237. sort: 5
  238. })
  239. } else if ('snm3u8' == key) {
  240. arr.push({
  241. flag: name[key],
  242. url: playMap[key],
  243. sort: 6
  244. })
  245. } else if ('qhm3u8' == key) {
  246. arr.push({
  247. flag: name[key],
  248. url: playMap[key],
  249. sort: 7
  250. })
  251. } else {
  252. arr.push({
  253. flag: name[key] ? name[key] : key,
  254. url: playMap[key],
  255. sort: 8
  256. })
  257. }
  258. }
  259. arr.sort((a, b) => a.sort - b.sort);
  260. let playFrom = [];
  261. let playList = [];
  262. arr.map(val => {
  263. if (!/undefined/.test(val.flag)) {
  264. playFrom.push(val.flag);
  265. playList.push(val.url);
  266. }
  267. })
  268. VOD.vod_play_from = playFrom.join('$$$');
  269. VOD.vod_play_url = playList.join('$$$');
  270. } else {
  271. VOD.vod_play_from = node.vod_play_from;
  272. VOD.vod_play_url = node.vod_play_url;
  273. }
  274. } catch (e) {
  275. log("获取二级详情页发生错误:" + e.message);
  276. }
  277. `,
  278. 搜索: `js:
  279. let d = [];
  280. let jsondata = [];
  281. let videoList = [];
  282. if (/v1\\.vod/.test(HOST)) {
  283. input = (HOST + '/'+ input.split('/')[3]).replace('/search','').replace('text=','wd=').replace('pg=','page=');
  284. jsondata = JSON.parse(request(input));
  285. videoList = jsondata.data.list;
  286. } else {
  287. input = HOST + '/'+ input.split('/')[3]
  288. jsondata = JSON.parse(request(input));
  289. videoList = jsondata.list || jsondata.data;
  290. }
  291. // log('videoList =========> '+stringify(videoList));
  292. videoList.forEach(it => {
  293. d.push({
  294. url:it.vod_id,
  295. title:it.vod_name,
  296. img:it.vod_pic.startsWith('http') ? it.vod_pic : it.vod_pic.startsWith('//') ? 'https:' + it.vod_pic : it.vod_pic.startsWith('/') ? getHome(HOST) + it.vod_pic : getHome(HOST) + '/' + it.vod_pic,
  297. desc:it.vod_remarks,
  298. });
  299. });
  300. setResult(d);
  301. `,
  302. }